@include('Home.head')
<style type="text/css">
   .find-font-store {
    font-size: 13px;
    color: #5db95d;
}

 #store_keyword_btn {
    width: 70px;
    height: 35px;
    margin-left: 5%;
    text-align: center;
    border: none;
    outline: none;
    border-radius: 5px;
    background: #5cb95c;
    color: #fff;
    margin-top: 1%;
}

#store_keyword {
    width: 72%;
    float: left;
}

.notice {
    padding: 0 15px;
    color: #c61b18;
    margin-bottom: 10px;
}




.swiper-container {
	        width: 100%;

	        /* overflow: hidden; */
	    }

	    label {
	        margin-bottom: 0px;
	        font-weight: 100;
	    }

	    .swiper-container img {
	        width: 100%;
			height: 375px;
	    }

	    .swiper-pagination-bullet-active {
	        background: #6a6a6a !important;
	    }

	    .swiper-pagination-bullets {
	        bottom: 90px;
	    }

	    .video-js {
	        width: 100%;
	        height: 210px;
	    }

	    .buttom {
	        color: black;
	        border: 1px solid;
	        padding: 0 5px;
	        display: inline-block;
	        width: 25px;
	        text-align: center;
	    }

	    .number_s {
	        background-color: #fff;


	        margin: 10px 0px;
	        padding: 15px 17px;
	        border-radius: 6px;

	    }

	    /* #course ul {
	    display: block;
	    justify-content: space-around;
	    margin-top: 0;
	    color: #c3c3c3;
	} */
	    .Specifications {
	        color: black;


	    }

	    .Specifications1 {
	        /* height:100px */
	    }

	    .Specifications2 {
	        display: none
	    }

	    #course ul {
	        display: inline-flex;

	    }

	    .stock {
	        margin: 0 0 0 150px
	    }

	    #app {
	        overflow: hidden;
	    }

	    .Specifications_input {
	        display: none
	    }

	    .Specifications_xz {

	        background: #FFFFFF;
	        text-align: center;
	        border: 1px solid #A7AEBF;
	        border-radius: 20px;
	        font-size: 12px;
	        margin-top: 10px;
	        margin-right: 15px;
	        margin-bottom: 5px;
	        padding: 6px 10px;
	        height: 26px;
	        line-height: 14px;

	    }

	    .row {
	        display: inline-block;
	    }

	    .scrollspy-nav a {
	        color: #333333
	    }

	    .scrollspy-nav a.am-active {
	        color: #2B8DFF
	    }

	    .scrollspy-nav a.am-active:after {
	        background-color: #2B8DFF;
	        width: 50%;
	        left: 20px;
	    }

	    .oldprice {
	        text-decoration: line-through;
	        font-size: 12px;
	        color: #999999;
	        font-weight: Regular;
	        padding-left: 10px
	    }

	    * + h1, * + h2, * + h3, * + h4, * + h5, * + h6 {
	        margin-top: 0px
	    }

	    #course ul {
	        margin-top: 0px;
	        justify-content: space-between;
	    }

	    .nowprice {
	        color: #E85B4D;
	        font-size: 24px;
	        font-weight: 900;
	    }

	    .buttom {
	        border: none;
	        color: #333333;
	        font-size: 16px;
	        font-weight: Bold;

	    }

	    a:focus, a:hover {
	        color: #000
	    }

	    input {
	        background: none;
	        outline: none;
	        border: none;
	    }

	    .font {
	        color: #333333;
	        font-size: 16px;
	        font-weight: Medium;

	    }

	    .module {
	        background: #fff;
	        margin-bottom: 10px
	    }

	    #comment .comment-hd {
	        padding: 15px;
	    }

	    #comment .comment-hd .comment-more {
	        color: #A7AEBF;
	        font-size: 12px;
	        font-weight: Regular;

	    }

	    .recommend .recommend-bd .am-gallery-item .am-gallery-desc {

	        margin-top: 10px;
	    }

	    .btngm {
	        width: 134px;
	        height: 38px;
	        background: #2B8DFF;
	        box-shadow: 0px 3px 6px rgba(43, 141, 255, 0.2);
	        opacity: 1;
	        border-radius: 20px;
	        line-height: 38px
	    }

	    .scrollspy-nav a.am-active:after {
	        background-color: #2B8DFF;
	        width: 50%;
	        left: 24px;
	    }


	    .number_s {

	        background-color: #fff;

	        margin: 10px 0px;
	        padding: 15px 15px;
	        border-radius: 6px;
	    }

	    .recommend .recommend-bd .am-gallery-default > li:nth-child(2n) {
	        padding-left: 4px;

	    }

	    .recommend .recommend-bd .am-gallery-item {
	        box-shadow: 0px 10px 9px #eee;
	        padding: 0px;
	        border-top-left-radius: 10px;
	        border-top-right-radius: 10px;
	    }

	    .recommend .recommend-bd .am-gallery-default > li:nth-child(2n+1) {
	        padding-right: 4px;

	    }

	    .recommend .recommend-bd .am-gallery-item h3 {
	        font-size: 9pt;
	        color: #424141;
	        letter-spacing: .5px;
	        font-weight: 700;
	        padding: 0 7px;
	    }

	    .recommend .recommend-bd .am-gallery-item .am-gallery-desc {
	        margin: 10px 0px;
	        height: 51px;

	    }

	    .scrollspy-nav a.am-active:after {
	        width: 20%;
	        left: 37px;
	        top: 88%;
	    }

	    .recommend .recommend-bd .am-gallery-item img {
	        border-top-left-radius: 10px;
	        border-top-right-radius: 10px;
	        height: 121px;
	        border-bottom-left-radius: 0px;
	        border-bottom-right-radius: 0px
	    }

	    .recommend .recommend-bd .am-gallery-item h3 {
	        font-size: 9pt;
	        color: #424141;
	        letter-spacing: .5px;
	        font-weight: 700;
	        padding: 0px 8px;
	    }

	    .recommend .recommend-bd .am-gallery-default > li {
	        margin-bottom: 0px;
	    }

	    .payment-footer {
	        display: flex;
	        align-items: center;
	        background-color: #fff;
	        padding: 0 15px;
	        height: 50px;
	        box-shadow: 0px -1px 3px rgba(0, 0, 0, 0.05);
	    }

	    .payment-footer .service-collection {
	        flex: 1;
	        display: flex;
	    }

	    .payment-footer .buy-now {
	        flex: 2;
	        color: #fff;
	        font-size: 17px;
	        text-align: center;
	        margin-left: 15px;
	    }

	    .payment-footer .buy-now {
	        flex: 2;
	        color: #fff;
	        font-size: 14px;
	        text-align: center;
	        margin-left: 15px;
	    }

	    .baoyou {
	        margin-left: 15px;
	        margin-bottom: 10px;
	        width: 48px;
	        height: 18px;
	        background: rgba(255, 229, 226, 1);
	        opacity: 1;
	        border-radius: 9px;
	        font-size: 12px;
	        text-align: center;
	        font-weight: 400;
	        line-height: 1px;
	        color: rgba(255, 0, 0, 1);
	        opacity: 1;
	    }

	    .recommend .recommend-bd ul {
	        padding: 5px 0 10px
	    }

	    .am-gallery-default > li {
	        width: 46%;
	    }

	    .recommend .recommend-bd .am-gallery-item {
	        box-shadow: 5px 10px 9px #eee;
	    }

	    .recommend .recommend-bd .am-gallery-default > li:nth-child(2n+1) {
	        padding-right: 0px !important;
	        float: left;
	        margin-left: 10px
	    }

	    .recommend .recommend-bd .am-gallery-default > li:nth-child(2n) {
	        padding-left: 0px !important;
	        float: right;
	        margin-right: 10px
	    }

	    .recommend .recommend-bd .am-gallery-item {
	        border-radius: 10px !important;
	    }
	    #addCarts {
	        background: -webkit-linear-gradient(left, #ffd01e, #ff8917);
	        background: linear-gradient(to right, #ffd01e, #ff8917);
	        height: 40px;
	        font-weight: 500;
	        font-size: 14px;
	        border: none;
	        border-radius: 0;
	        overflow: hidden;
	        position: relative;
	        display: inline-block;
	        box-sizing: border-box;
	        margin: 0;
	        padding: 0;
	        line-height: 1.2;
	        text-align: center;
	        -webkit-box-flex: 1;
	        -webkit-flex: 1;
	        flex: 1;
	        height: 40px;
	        font-weight: 500;
	        font-size: 14px;
	        border: none;
	        border-radius: 0;
	        margin-left: 5px;
	        border-top-left-radius: 999px;
	        border-bottom-left-radius: 999px;
	    }
	    #addCarts:before {
	        position: absolute;
	        top: 50%;
	        left: 50%;
	        width: 100%;
	        height: 100%;
	        background-color: #000;
	        border: inherit;
	        border-color: #000;
	        border-radius: inherit;
	        -webkit-transform: translate(-50%, -50%);
	        transform: translate(-50%, -50%);
	        opacity: 0;
	        content: ' ';
	     }
	    #goCarts {
	        background: -webkit-linear-gradient(left, #ff6034, #ee0a24);
	        background: linear-gradient(to right, #ff6034, #ee0a24);
	        height: 40px;
	        font-weight: 500;
	        font-size: 14px;
	        border: none;
	        border-radius: 0;
	        overflow: hidden;
	        position: relative;
	        display: inline-block;
	        box-sizing: border-box;
	        margin: 0;
	        padding: 0;
	        line-height: 1.2;
	        text-align: center;
	        -webkit-box-flex: 1;
	        -webkit-flex: 1;
	        flex: 1;
	        height: 40px;
	        font-weight: 500;
	        font-size: 14px;
	        border: none;
	        border-radius: 0;
	        margin-right: 5px;
	        border-top-right-radius: 999px;
	        border-bottom-right-radius: 999px;
			/* border-top-left-radius: 999px;
			border-bottom-left-radius: 999px; */
	    }
	    #goCarts:before {
	        position: absolute;
	        top: 50%;
	        left: 50%;
	        width: 100%;
	        height: 100%;
	        background-color: #000;
	        border: inherit;
	        border-color: #000;
	        border-radius: inherit;
	        -webkit-transform: translate(-50%, -50%);
	        transform: translate(-50%, -50%);
	        opacity: 0;
	        content: ' ';
	    }

	    .payment-footer .buy-now {
	        overflow: hidden;
	    }
	    .buy {
	        flex: 3;
	        margin-left: 5px;
	        display: flex;
	        color: #fff;
	    }
		.payment-footer .service-collection>a img {
		    width: 20px;
		}

		.payment-footer .service-collection>a span {
		    line-height: 20px;
		}

		.payment-footer .service-collection>a {
		    flex: 1;
		    display: flex;
		    flex-direction: column;
		    align-items: center;
		    justify-content: center;
		    color: #a5a6a6;
		    font-size: 14px;
		}
		.op{
			text-decoration:line-through;
			color: gray;
			font-weight: 600;
			margin-top: 7px;
			padding-left: 0px;
			font-size: 12px;
			padding-right: 25px;
			border: none;
			margin-top: -4px;
		}
</style>
<body>
<div class="container" id="app">
    <header data-am-widget="header" class="am-header am-header-default my-header" style="background-color: black;color: rgb(255,215,0);">
        <div class="am-header-left am-header-nav">
            <a href="javascript:history.back(-1);" class="">
                <i class="am-header-icon am-icon-chevron-left"></i>
            </a>
        </div>
        <h1 class="am-header-title">
            <a href="#title-link" class="">提交订单</a>
        </h1>
        <!-- <div class="am-header-right am-header-nav">
            <a href="#right-link" class="">
                <i class="am-header-icon  am-icon-home"></i>
            </a>
        </div> -->
    </header>
    <div id="allmap"></div>
	<div class="gray-panel">
    	<div class="paoduct-title-panel">
        	<h2 class="checkout-h2"><span class="am-badge am-round am-badge-warning ">订</span> 订单信息</h2>
            <div>
                <div class="cart-list-panel" style="border: none;box-shadow:none;">
                    <ul class="am-avg-sm-1 cart-panel-ul">
                        <li v-for="val in order.OrderComment" style="height: auto;">
                            <div class="imgpanel"><a v-on:click="jump(val.goodsid)"><img  :src="val.img" style="display: block;width: 100%;height: 100%;" /></a></div>
                            <div class="infopanel">
                                <h3 style="width: 140px;"><a v-on:click="jump(val.goodsid)">@{{ val.goodsname }}</a></h3>
								<p >单价：<span class="red2 bold">@{{ val.price }}</span> 元</p>
								<p >总数量：<span class="red2 bold">@{{ val.number }}</span> </p>
                                <p>总价格：<span class="red2 bold">@{{ order.originalprice }}</span> 元
                                <p>规格：@{{ val.specs }}</p>
								配送方式：
								<td>
									<span v-show="order.freight == 1" style="color: red">包邮</span>
									<!-- <span v-show="val.withdrawal_type == 3">分享积分</span> -->
									<span v-show="order.freight == 0" style="color: red">自提</span>
								</td>

                            </div>
                        </li>
                    </ul>
                </div>
{{--                <div class="cart_foot">共选中：<span class="red2 bold" id="total_good">@{{ order.totalNumber }}</span>种商品，--}}
{{--                    总数量：<span class="red2 bold" id="total_jifen">@{{ order.totalShopNumber }}</span> 个，--}}
{{--                   邮费：<span class="red2 bold" id="total_amount" v-if="order.is_self == 0">@{{ order.freight }}</span>--}}
{{--                    <span class="red2 bold" id="total_amount" v-if="order.is_self == 1">自提</span>元，--}}
{{--                     总价：<span class="red2 bold" id="total_amount">@{{ order.originalprice }}</span>元--}}
{{--                </div>--}}
            </div>
        </div>
        <div class="paoduct-title-panel">
            <h2 class="checkout-h2"><span class="am-badge am-round am-badge-warning ">收</span> 收货信息
                <!-- <label class="am-checkbox-inline" style="float: right;margin-right: 15px">
                    <input type="checkbox" v-model="pick"  value="" data-am-ucheck> 自提
                </label> -->
{{--				<label class="am-checkbox-inline" style="float: right;margin-right: 15px;color: red;">--}}
{{--				     不包邮--}}
{{--				</label>--}}
            </h2>

            <div class="partners-title-panel" >
                <div class="partners-title-panel-title" v-if="address != ''" style="height: 80px;padding-left: 10px;">
                    {{--v-show="address.default"--}}
                    @{{ address.name }}  &nbsp;@{{ address.phone }} <a v-show="address.address_type" v-on:click="address_jump(order.id)"  style="color: red;float: right;margin-right: 20px"><span class="am-badge am-round am-badge-warning ">修改地址</span></a><br>
                    <a style="width:100%;height:49px;font-size: 12px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">@{{ address.province }}@{{ address.city }}@{{ address.district }}@{{ address.address }}</a>
                </div>
                <div  v-if="address.address_type == '0'">
                    <p class="am-text-center" v-on:click="address_jump(order.id)"><button type="button" class="am-btn am-btn-default am-radius am-btn-block" >添加收货地址</button></p>
                </div>
            </div>
        </div>
        <div class="paoduct-title-panel">
        	<h2 class="checkout-h2"><span class="am-badge am-round am-badge-warning ">支</span> 支付方式
{{--                <label class="am-checkbox-inline" v-if="order.ordertype ==3" style="float: right;margin-right: 15px">--}}
{{--                    <input type="checkbox" v-model="again" v-on:click="Revisit()" value="" data-am-ucheck> 阅读积分--}}
{{--                </label>--}}
            </h2>
            <div class="notice" v-if="order.notice">注:@{{ order.notice }}!</div>
            <ul class="am-list am-text-sm my-pay-ul" v-if="moeny.code == 1">
{{--				<li v-show="moeny.type == 2"><a href="javascript:;" >&nbsp;&nbsp;&nbsp;<img src="/img/home/user/money.png" class="payimg" />&nbsp;&nbsp;&nbsp;&nbsp;阅读积分<samll class="my-pay-yue">：<span class="red2">@{{ moeny.data.credit4 }}</span></samll></a></li>--}}
            	<li><a href="javascript:;" >&nbsp;&nbsp;&nbsp;<img src="/img/home/user/money.png" class="payimg" />&nbsp;&nbsp;&nbsp;&nbsp;购物积分<samll class="my-pay-yue">：<span class="red2">-@{{ moeny.data.credit1 }}</span></samll></a></li>
				<li ><a href="javascript:;" >&nbsp;&nbsp;&nbsp;<img src="/img/home/user/money.png" class="payimg" />&nbsp;&nbsp;&nbsp;&nbsp;奖金积分<samll class="my-pay-yue">：<span class="red2">@{{ moeny.data.credit2 }}</span></samll></a></li>

               <!-- <li v-show="moeny.type == 1"><a href="javascript:;" >&nbsp;&nbsp;&nbsp;<img src="/img/home/user/money.png" class="payimg" />&nbsp;&nbsp;&nbsp;&nbsp;复投币<samll class="my-pay-yue">：<span class="red2">@{{ moeny.data.credit3 }}</span></samll></a></li>
                <li v-show="moeny.type == 0"><a href="javascript:;" >&nbsp;&nbsp;&nbsp;<img src="/img/home/user/money.png" class="payimg" />&nbsp;&nbsp;&nbsp;&nbsp;积分<samll class="my-pay-yue">：<span class="red2">@{{ moeny.data.credit4 }}</span></samll></a></li> -->

                <!-- <li ><a href="javascript:;" >&nbsp;&nbsp;&nbsp;<img src="/img/home/user/money.png" class="payimg" />&nbsp;&nbsp;&nbsp;&nbsp;代金券<samll class="my-pay-yue">：<span class="red2">@{{ moeny.data.voucher }}</span></samll></a></li> -->
            </ul>
            <ul class="am-list am-text-sm my-pay-ul" v-if="moeny.code == 0">
                <span class="red2">@{{ moeny.data }}</span>
            </ul>
            <div>
                <ul class="am-avg-sm-2 am-text-center">

                  <!--   <li class="am-text-center am-padding-sm" v-if="order.ordertype == 1 && status == 0"><button type="button" v-on:click="paymall()" class="am-btn am-btn-danger am-btn-block am-radius">确定支付</button></li>
                  <li class="am-text-center am-padding-sm" v-if="order.ordertype == 2 && status == 0"><button type="button" v-on:click="paymicro()" class="am-btn am-btn-danger am-btn-block am-radius">确定支付</button></li>
                  <li class="am-text-center am-padding-sm" v-if="order.ordertype == 3 && status == 0"><button type="button" v-on:click="exmall()" class="am-btn am-btn-danger am-btn-block am-radius">确定支付</button></li>
                   -->

                   <!-- <li class="am-text-center am-padding-sm" v-if="order.ordertype == 1 && status == 0" style="width: 100%;"><button type="button" onclick="payBefore(1)" class="am-btn  am-btn-success am-radius" style="border-radius: 50px;">立即支付</button></li>
                    <li class="am-text-center am-padding-sm" v-if="order.ordertype == 2 && status == 0" style="width: 100%;"><button type="button" onclick="payBefore(2)" class="am-btn am-btn-success am-radius" style="border-radius: 50px;">立即支付</button></li>
                    <li class="am-text-center am-padding-sm" v-if="order.ordertype == 3 && status == 0" style="width: 100%;"><button type="button" onclick="payBefore(3)" class="am-btn  am-btn-success am-radius" style="border-radius: 50px;">立即支付</button></li> -->
					<!-- <li class="am-text-center am-padding-sm" v-if="status == 0" style="width: 100%;"><button type="button" v-on:click="paymicro()" class="am-btn am-btn-danger am-btn-block am-radius" style="border-radius: 50px;">确定支付</button></li> -->
                    <!-- <li class="am-text-center am-padding-sm" v-if="status == 1" style="width: 100%;"><button type="button" class="am-btn am-btn-danger am-btn-block am-radius" disabled="disabled" style="border-radius: 50px;">支付中..</button></li> -->
                    <!-- <li class="am-text-center am-padding-sm"><button type="button" v-on:click="goshop()" class="am-btn am-btn-success am-btn-block am-radius" style="border-radius: 50px;">继续购物</button></li> -->
                </ul>
            </div>
        </div>
		<div class="am-form-group am-form-icon">
			<i class="am-icon-lock" ></i>
			<input type="password" class="am-form-field  my-radius" v-model="zfpassword"  placeholder="商城支付密码">
		</div>
    </div>


    <footer data-am-widget="navbar" class="am-navbar am-cf sxy-footer payment-footer" id="" v-cloak>
        <div class="service-collection">
            <a href="/home/excellent/index">
                <img src="http://qiniu.baoliy168.com/%E7%BB%84%203478%403x.png" alt="">
                <span style="color:#333333;font-size:10px">首页</span>
            </a>
            <a href="tel:15736167565">
                <img src="http://hb.baoliy168.com/shops/assets/images/kf.png" alt="">
                <span style="color:#333333;font-size:10px">客服</span>
            </a>
        </div>
        <div class="buy">
            <!-- <button id="addCarts" v-on:click="car(goods.id)" style="font-size: 16px;">加入购物车</button>
            <button id="goCarts" v-on:click="add(goods.id)" style="font-size: 16px;">立即购买</button> -->
			<li class="am-text-center am-padding-sm" v-if="order.ordertype == 1 && status == 0" style="width: 100%;"><button type="button" onclick="payBefore(1)" class="am-btn  am-btn-success am-radius" style="border-radius: 50px;width: 100%;">立即支付</button></li>
			 <li class="am-text-center am-padding-sm" v-if="order.ordertype == 2 && status == 0" style="width: 100%;"><button type="button" onclick="payBefore(2)" class="am-btn am-btn-success am-radius" style="border-radius: 50px;width: 100%;">立即支付</button></li>
			 <li class="am-text-center am-padding-sm" v-if="order.ordertype == 3 && status == 0" style="width: 100%;"><button type="button" onclick="payBefore(3)" class="am-btn  am-btn-success am-radius" style="border-radius: 50px;width: 100%;">立即支付</button></li>
			 <li class="am-text-center am-padding-sm" v-if="status == 1" style="width: 100%;"><button type="button" class="am-btn am-btn-danger am-btn-block am-radius" disabled="disabled" style="border-radius: 50px;">支付中..</button></li>
        </div>
    </footer>
</div>
<iframe id="geoPage" width=0 height=0 frameborder=0  style="display:none;" scrolling="no"
    src="https://apis.map.qq.com/tools/geolocation?key=Y3JBZ-XWBKP-6GLDC-LDO4W-BH4WV-WMFI3&referer=baoli">
</iframe>
</body>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=nSxiPohfziUaCuONe4ViUP2N&v"></script>
<script type="text/javascript">

    // 百度地图API功能
    var map = new BMap.Map("allmap");
    var point = new BMap.Point(116.331398,39.897445);
    map.centerAndZoom(point,12);
    var geolocation = new BMap.Geolocation();
    geolocation.getCurrentPosition(function(r){
        if(this.getStatus() == BMAP_STATUS_SUCCESS){
            var mk = new BMap.Marker(r.point);
            map.addOverlay(mk);
            map.panTo(r.point);
            var latitudes = r.point.lng+','+r.point.lat;
            nearbyStores( latitudes );
            app.latitudes = latitudes;
            var data={
        　　　　　　location:r.point.lat+','+r.point.lng,
        　　　　　　key:"Y3JBZ-XWBKP-6GLDC-LDO4W-BH4WV-WMFI3",
        　　　　　　get_poi:0
    　　　　　　}
            var url="http://apis.map.qq.com/ws/geocoder/v1/?";
            data.output="jsonp";
            $.ajax({
                type:"get",
                dataType:'jsonp',
                data:data,
                jsonp:"callback",
                jsonpCallback:"QQmap",
                url:url,
                success:function(json){
                    if ( json.message == 'query ok' && json.status == 0 ) {
                           app.user_city = json.result.ad_info.city;
                    } else {
                        layer.msg("当前用户市查询失败!");
                        return false;
                    }
                },
                error : function(err){
                    layer.msg("服务端错误，请刷新浏览器后重试");
                    return false;
                }

             })
        }
        else {
            alert('failed'+this.getStatus());
        }
    },{enableHighAccuracy: true})







    function findStoreInfo( number, type )
    {
        numbers = number.split(',');
        var data={
        　　　　　　location:numbers[1]+','+numbers[0],
        　　　　　　key:"Y3JBZ-XWBKP-6GLDC-LDO4W-BH4WV-WMFI3",
        　　　　　　get_poi:0
        　　　　}
        var url="http://apis.map.qq.com/ws/geocoder/v1/?";
        data.output="jsonp";
        $.ajax({
            type:"get",
            dataType:'jsonp',
            data:data,
            jsonp:"callback",
            jsonpCallback:"QQmap",
            url:url,
            success:function(json){
                if ( json.message == 'query ok' && json.status == 0 ) {
                     if ( app.user_city != json.result.ad_info.city ) {
                        layer.msg("门店绑定不能跨市!");
                        return false;
                     } else {
                        switch ( type ) {
                            case 1:
                                app.paymall();
                                break;
                            case 2:
                                app.paymicro();
                                break;
                            case 3:
                                app.exmall();
                                break;
                        }
                     }
                } else {
                    layer.msg("绑定门店所在市查询失败!");
                    return false;
                }
            },
            error : function(err){
                layer.msg("服务端错误，请刷新浏览器后重试");
                return false;
            }

         })
    }



    function payBefore( type )
    {
        // var storesnumber = $("#store_number").val();
        // if ( storesnumber != "" && app.first_bind == 1 ) {
        //     $.post("/home/stores/stores",{'_token':'{{csrf_token()}}',class:'lanLong',number:storesnumber },function (res) {
        //         if (res.code) {
        //            findStoreInfo( res.data.latitude, type );
        //         } else {
        //             layer.msg(res.data);
        //             return false;
        //         }
        //     });
        // } else {
            switch ( type ) {
                case 1:
                    app.paymall();
                    break;
                case 2:
                    app.paymicro();
                    break;
                case 3:
                    app.paymicro();
					//app.exmall();
                    break;
            }
        // }
    }



    function nearbyStores( latitude )
    {
        $.post("/home/stores/stores",{'_token':'{{csrf_token()}}',class:'near_stores',latitude:latitude },function (res) {
            if (res.code) {
               app.stores = res.data;
                if ( app.stores[0].shop_name != "" ) {
                    app.nearbyStores = 1;
                }
                if ( res.is_bind == 1 ) {
                    changeStores(app.stores[0].shop_name);
                }
            } else {
                $("#district1").html("");
                $("#district1").append("<option>暂无附近门店推荐</option>");
            }
            if (res.is_bind == 0 ) {
                app.first_bind = 1;
            }
        });
    }

    function changeStores( e )
    {
        $.post("/home/order", { '_token': '{{csrf_token()}}', class:'storeNumber', shop_name:e }, function (res) {
            if (res.code == 1 ) {
                $("#store_number").val(res.data);
                app.store_number = res.data
            }
        });
    }

    function changeStores1(a) {
       $("#store_number").val(a);
       app.store_number = a
    }


   function storeFind()
    {
        var store_keyword = $('#store_keyword').val();
        if ( store_keyword == '' ) {
            layer.msg('请输入门店关键字');
            return false;
        }
        $.post("/home/stores/stores",{'_token':'{{csrf_token()}}',class:'stores_finds',store_keyword:store_keyword },function (res) {
            if (res.code) {
                layer.msg('搜索成功,请在下方选择你想要的门店',{time:1500},function () {
                    $("#district2").html("");
                    $("#district2").append("<option>点击选择更多门店</option>");
                    app.stores1 = res.data;
                    $.each(app.stores1,function(key,value){
                        $("#district2").append("<option value='"+value.number+"'>"+value.number+"</option>");

                    })
                    //console.log(res.data);
                });
            } else {
                layer.msg( res.data );
                $("#district2").html("");
                $("#district2").append("<option>暂无门店选择</option>");
            }
        });
    }


</script>
<script>
    var app = new Vue({
        el: "#app",
        data: {
			zfpassword:'',
            title: '我的订单',
            pick: false,
            again: false,//复消
            order: {},
            // address_data:'',
            address: {
                id: '',

            },
            nodes: '',//接点人
            area: 'A',//区域
            moeny: {},
            status: 0,
            stores: {},//门店
            stores1: {},//搜索出的门店
            stores_id: {},//id
            store_number: '',
            lng: 0,//经纬度
            lat: 0,//经纬度
            latitudes: '',//用户当前经纬度
            nearbyStores: 0,
            first_bind: 0,
            user_city: '',
            specs_str: '',
            specs_arr: [],
			group_id:'',
			address_type:'',
			bid:''
        },
        watch: {
            pick: function (val) {
                var id = this.obtain('id');
                var again = this.again ? 1 : 0;
                var address_id = this.obtain('address_id');
                if(address_id == undefined && address_id == 0 && address_id == null){
                    address_id = 0;
                }
                $.post("/home/order", {
                    '_token': '{{csrf_token()}}',
                    class: 'find',
                    id: id,
                    stores_number: this.store_number,
                    pick: val,
                    again: again,
                    address_id:address_id,
                }, function (res) {
                    if (res.code) {
                        app.order = res.data.order
                        app.address = res.data.address
                        app.moeny = res.data.moeny
                    } else {
                        layer.msg(res.data, {time: 500}, function () {
                            // window.location.href='/home/member/myoreder';
                        });
                    }
                });
            },
            store_number: function (val) {
                var again = this.again ? 1 : 0
                var id = this.obtain('id');
                var address_id = this.obtain('address_id');
                if(address_id == undefined && address_id == 0 && address_id == null){
                    address_id = 0;
                }
                $.post("/home/order", {
                    '_token': '{{csrf_token()}}',
                    class: 'find',
                    id: id,
                    stores_number: val,
                    pick: this.pick,
                    again: again,
                    address_id:address_id,
                }, function (res) {
                    if (res.code) {
                        app.order = res.data.order
                        app.address = res.data.address
                        app.moeny = res.data.moeny
                    } else {
                        layer.msg(res.data, {time: 500}, function () {
                            // window.location.href='/home/member/myoreder';
                        });
                    }
                });
            }
        },
        methods: {
            //初始化 系统管理员列表
            initialize: function () {
                var id = this.obtain('id');
                var address_id = this.obtain('address_id');
                if(address_id == undefined && address_id == 0 && address_id == null){
                    address_id = 0;
                }
                console.log(address_id)
                if (id > 0) {
                    $.post("/home/order", {'_token': '{{csrf_token()}}',class:'find',id:id,again:0,address_id:address_id}, function (res) {
                        //console.log(res);
                        if (res.code) {
                            app.order = res.data.order
                            app.address = res.data.address
                            app.moeny = res.data.moeny
                            app.store_number = res.data.address.stores_number === '0' ? '' : res.data.address.stores_number
                            {{--$.post("/home/order", {'_token': '{{csrf_token()}}',class:'freight',address_id:app.address.id,order_id:app.order.id},res=>{--}}
                                {{--console.log(res)--}}
                                {{--app.address_data=res.data--}}
                            {{--})--}}
							if(app.address.address_type == 0){
								layer.msg('请添加收货地址')
							}
                             if ( app.order.mall_num ) {
                                app.specs_arr.push( app.order.mall_num.split(" [ ")[1].split(" ]")[0] );
                                app.specs_str = app.order.mall_num.split(" [ ")[1].split(" ]")[0];
                                //console.log(app.specs_str)
                             } else {
                                for (var i = 0; i < app.order.OrderComment.length; i++ ) {
                                      if ( app.order.OrderComment[i].specs != null ) {
                                        app.specs_arr.push( app.order.OrderComment[i].specs );
                                      }
                                }
                                console.log(app.specs_arr)
                             }
                        } else {
                            layer.msg(res.data,{time:500},function () {
                                // window.location.href='/home/member/myoreder';
                            });
                        }
                    });

                }
            },
            jump:function (id) {
                window.location.href='/home/microShop/productmicro?id='+id;
            },
            address_jump:function(id){
                window.location.href='/home/member/addresslist?order_id='+id;
            },
            //优品特选
            paymall:function () {
                var id = this.obtain('id');
                var storesnumber = $("#store_number").val();
                var latitudes = app.latitudes;
                var nearbyStores = app.nearbyStores;
                var specs = app.specs_arr;
				if(app.status == 0) {
				    app.status = 1;
				    layer.msg('支付中', {
				        icon: 16
				        , shade: 0.01
				    });
				    $.post("/home/member/addMicro", {
				        '_token': '{{csrf_token()}}',
				        id: id,
				        pick: app.pick,
				        again: app.again,
				        addressid: app.address.id,
				        stores_number:storesnumber,
				        latitudes:latitudes,
				        nearbyStores:nearbyStores,
				        specs:specs
				    }, function (res) {
				        layer.closeAll('loading');
				        if (res.code == 1) {
				            layer.msg(res.data, {time: 500}, function () {
				                window.location.href = '/home/member/index';
				            });
				        } else {
				            app.status = 0;
				            layer.msg(res.data);
				        }
				    });
				}else {
				    layer.msg('支付中..');return;
				}
                // if (id > 0) {
                //     if(app.address.id == undefined){
                //         layer.msg('请选择收货地址');
                //         return false;
                //     }
                //     if ( storesnumber != '' && app.first_bind == 1 ) {
                //         layer.confirm('您确定要绑定该门店编号吗,该操作不可回退,请谨慎填写!', {
                //             btn: ['确定','取消'] //按钮
                //         }, function(){
                //             //确认
                //             if(app.status == 0) {
                //                 app.status = 1;
                //                 layer.msg('支付中', {
                //                     icon: 16
                //                     , shade: 0.01
                //                 });
                //                 $.post("/home/member/excellent  ", {
                //                     '_token': '{{csrf_token()}}',
                //                     id: id,
                //                     pick: app.pick,
                //                     again: app.again,
                //                     addressid: app.address.id,
                //                     stores_number:storesnumber,
                //                     latitudes:latitudes,
                //                     nearbyStores:nearbyStores,
                //                     specs:specs
                //                 }, function (res) {
                //                     layer.closeAll('loading');
                //                     if (res.code) {
                //                         layer.msg(res.data, {time: 500}, function () {
                //                             window.location.href = '/home/member/myoreder';
                //                         });
                //                     } else {
                //                         app.status = 0;
                //                         layer.msg(res.data);
                //                     }
                //                 });
                //             }else {
                //                 layer.msg('支付中..');return;
                //             }
                //         }, function(){
                //             //取消
                //             //return false;
                //         });
                //     } else {
                //         if(app.status == 0) {
                //             app.status = 1;
                //             layer.msg('支付中', {
                //                 icon: 16
                //                 , shade: 0.01
                //             });
                //             $.post("/home/member/excellent", {
                //                 '_token': '{{csrf_token()}}',
                //                 id: id,
                //                 pick: app.pick,
                //                 again: app.again,
                //                 addressid: app.address.id,
                //                 stores_number:storesnumber,
                //                 latitudes:latitudes,
                //                 nearbyStores:nearbyStores,
                //                 specs:specs
                //             }, function (res) {
                //                 layer.closeAll('loading');
                //                 if (res.code) {
                //                     layer.msg(res.data, {time: 500}, function () {
                //                         window.location.href = '/home/member/myoreder';
                //                     });
                //                 } else {
                //                     app.status = 0;
                //                     layer.msg(res.data);
                //                 }
                //             });
                //         }else {
                //             layer.msg('支付中..');return;
                //         }
                //     }
                // }
            },
            //超级商城
            exmall:function(){
                var id = this.obtain('id');
                var storesnumber = $("#store_number").val();
                var latitudes = app.latitudes;
                var nearbyStores = app.nearbyStores;
                var specs = app.specs_str;
                if (id > 0) {
                    if(app.address.id == undefined){
                        layer.msg('请选择收货地址');
                        return false;
                    }
                    if ( storesnumber != '' && app.first_bind == 1 ) {
                        layer.confirm('您确定要绑定该门店编号吗,该操作不可回退,请谨慎填写!', {
                        btn: ['确定','取消'] //按钮
                        }, function(){
                            //确认
                        if(app.status == 0) {
                            app.status = 1;
                            layer.msg('支付中', {
                                icon: 16
                                , shade: 0.01
                            });
                            $.post("/home/member/exMall", {
                                '_token': '{{csrf_token()}}',
                                id: id,
                                addressid: app.address.id,
                                stores_number:storesnumber,
                                latitudes:latitudes,
                                nearbyStores:nearbyStores,
                                specs:specs
                            }, function (res) {
                                layer.closeAll('loading');
                                if (res.code) {
                                    layer.msg(res.data, {time: 500}, function () {
                                        window.location.href = '/home/member/myoreder';
                                    });
                                } else {
                                    app.status = 0;
                                    layer.msg(res.data);
                                }
                            });
                            } else {
                                layer.msg('支付中..');return;
                            }
                        }, function(){
                            //取消
                        });
                    } else {
                      if(app.status == 0) {
                        app.status = 1;
                        layer.msg('支付中', {
                            icon: 16
                            , shade: 0.01
                        });
                        $.post("/home/member/exMall", {
                            '_token': '{{csrf_token()}}',
                            id: id,
                            addressid: app.address.id,
                            stores_number:storesnumber,
                            latitudes:latitudes,
                            nearbyStores:nearbyStores,
                            specs:specs
                        }, function (res) {
                            layer.closeAll('loading');
                            if (res.code) {
                                layer.msg(res.data, {time: 500}, function () {
                                    window.location.href = '/home/member/myoreder';
                                });
                            } else {
                                app.status = 0;
                                layer.msg(res.data);
                            }
                        });
                        } else {
                            layer.msg('支付中..');return;
                        }
                    }
                }
            },

            //store 自提
            stores:function () {
                // if (app.pick == false) {
                //     app.order.originalprice = parseFloat(app.order.originalprice) - parseFloat(app.order.freight)
                //     app.moeny.data.credit1 = parseFloat(app.moeny.data.credit1) - parseFloat(app.order.freight)
                // } else {
                //     app.order.originalprice = parseFloat(app.order.originalprice) + parseFloat(app.order.freight)
                //     app.moeny.data.credit1 = parseFloat(app.moeny.data.credit1) + parseFloat(app.order.freight)
                // }

            },
            //Revisit 复消
            Revisit: function () {
                var that = this;
                var id = this.obtain('id');
                var again = this.again ? 0 : 1;
                var address_id = this.obtain('address_id');
                if(address_id == undefined && address_id == 0 && address_id == null){
                    address_id = 0;
                }
                if (id > 0 ) {
                        $.post("/home/order", {
                            '_token': '{{csrf_token()}}',
                            class: 'find',
                            id: id,
                            again: again,
                            pick: this.pick,
                            address_id:address_id,
                            }, function (res) {
                            if (res.code) {
                                app.order = res.data.order
                                app.address = res.data.address
                                app.moeny = res.data.moeny
                            } else {
                                layer.msg(res.data, {time: 500}, function () {
                                    // window.location.href='/home/member/myoreder';
                                });
                            }
                        });
                } else {
                    that.initialize();
                }

            },

            //微商城
            paymicro: function () {
				var id1 = this.obtain('id1');
                var id = this.obtain('id');
				var bid = this.obtain('bid');
				var gotype = this.obtain('gotype');
                var storesnumber = $("#store_number").val();
                var latitudes = app.latitudes;
                var nearbyStores = app.nearbyStores;
                var specs = app.specs_arr;
				console.log(specs);
                if (id > 0) {
                    if(app.address.id == undefined){
                        layer.msg('请选择收货地址');
                        return false;
                    }
      //               if ( storesnumber != '' && app.first_bind == 1 ) {
      //                   layer.confirm('您确定要绑定该门店编号吗,该操作不可回退,请谨慎填写!', {
      //                   btn: ['确定','取消'] //按钮
      //                   },
						// function(){
      //                       //确认
      //                       if(app.status == 0) {
      //                           app.status = 1;
      //                           layer.msg('支付中', {
      //                               icon: 16
      //                               , shade: 0.01
      //                           });
      //                           $.post("/home/member/addMicro", {
      //                               '_token': '{{csrf_token()}}',
      //                               id: id,
      //                               pick: app.pick,
      //                               again: app.again,
      //                               addressid: app.address.id,
      //                               stores_number:storesnumber,
      //                               latitudes:latitudes,
      //                               nearbyStores:nearbyStores,
      //                               specs:specs
      //                           }, function (res) {
      //                               layer.closeAll('loading');
      //                               if (res.code) {
      //                                   layer.msg(res.data, {time: 500}, function () {
      //                                       window.location.href = '/home/member/myoreder';
      //                                   });
      //                               } else {
      //                                   app.status = 0;
      //                                   layer.msg(res.data);
      //                               }
      //                           });
      //                       }else {
      //                           layer.msg('支付中..');return;
      //                       }
      //                   }, function(){
      //                       //取消
      //                       //return false;
      //                   });
      //               }
					else {
                           if(app.status == 0) {
                                app.status = 1;
                                layer.msg('支付中', {
                                    icon: 16
                                    , shade: 0.01
                                });
                                $.post("/home/member/excellentSpecial", {
                                    '_token': '{{csrf_token()}}',
									bid:bid,
									gotype:gotype,
                                    id: id,
                                    pick: app.pick,
                                    again: app.again,
                                    addressid: app.address.id,
                                    zfpassword: app.zfpassword,
                                    stores_number:storesnumber,
                                    latitudes:latitudes,
                                    nearbyStores:nearbyStores,
                                    specs:specs
                                }, function (res) {
                                    layer.closeAll('loading');
                                    if (res.code == 1) {
                                        layer.msg(res.data, {time: 500}, function () {
                                            window.location.href = '/home/member/index';
                                        });
                                    } else {
                                        app.status = 0;
                                        layer.msg(res.data);
										
                                    }
                                });
                            }else {
                                layer.msg('支付中..');return;
                            }
                    }
                }
            },
            //获取url id
            obtain:function (val) {
                var query = window.location.search.substring(1);
                var vars = query.split("&");
                for (var i=0;i<vars.length;i++) {
                    var pair = vars[i].split("=");
                    if(pair[0] == val){
                        return pair[1];
                    }
                }
            },
            goshop:function () {
                if(app.order.ordertype == 1 ){ //1 直商城 2 微商城 3 0元商城
                    window.location.href='/home/straightShop/index';
                } else if(app.order.ordertype == 2 ){ //1 直商城 2 微商城 3 0元商城
                    window.location.href='/home/microShop/index';
                }
            }
        },
        //自动执行
        mounted: function () {
            this.initialize();
        },
    })
</script>
</html>
